import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => {
    return {
      userInfo: {
        name: 'Suger',
        age: 18
      }
    }
  },
  getters: {
    getUserInfo: (state) => state.userInfo
  },
  actions: {
    updateUserInfo(name) {
      this.userInfo.name = name
    }
  }
})
